#ifndef MUSICLIST_H
#define MUSICLIST_H

#include <QList>
#include <QUrl>
#include <QVector>
#include "music.h"
#include <QSet>

typedef QVector<Music>::iterator iterator;

class MusicList
{
public:
    MusicList();

    void addMusicsByUrl(const QList<QUrl> &musicUrls);

    iterator begin();

    iterator end();

    iterator findMusicById(const QString &musicId);

    void writeToDB();

    void readFromDB();

private:
    QVector<Music> musicList;

    QSet<QString> musicPaths;   //防止歌曲重复包含
};

#endif // MUSICLIST_H
